<meta charset="utf-8" />
<script>
   var str=prompt("请输入字符串");
  
   for(var i=str.length-1;i>=0;i--){
     document.write(str[i]);
}

    
</script>